﻿--#include "data\config\boss\SceneBossNpcConfig.lua" once   --场景BOSS-NPC

local npcId  = 211

NpcDialog[npcId]  = {}

local t  = NpcDialog[npcId]

--[[
通过NPC进入BOSS场景，
(如其他类似功能，无特殊要求的，直接拷贝粘贴代码即可)
]]
t.main = function(sysarg)
	local circleLimit = SceneBossNpcConfig[1].enterLevelLimit[1]
	local levelLimit  = SceneBossNpcConfig[1].enterLevelLimit[2]
	local strColor1 = Lang.ScriptTips.Color_Greed
	if not Actor.checkActorLevel( sysarg, levelLimit, circleLimit ) then
		strColor1 = Lang.ScriptTips.Color_Red
	end

	local strCond1 = string.format( Lang.ScriptTips.LevelLimitCircleFormat, strColor1, circleLimit, levelLimit )

	local strCond2 = ""
	if CheckSceneEnterDayLimit( SceneBossNpcConfig[1] ) then
		strCond2 = string.format( Lang.ScriptTips.OpenStatusFormat, Lang.ScriptTips.Color_Greed, Lang.ScriptTips.COM0070 )
	else
		strCond2 = string.format( Lang.ScriptTips.OpenStatusFormat, Lang.ScriptTips.Color_Red, Lang.ScriptTips.COM0069 )
	end

	local strCond  = string.format( "%s\n%s", strCond1,strCond2 )
	-----------------
	local strDesc 		= ""
	local okBtn 		= ""			--{按钮;样式;按钮名;函数名;描述}
	local strBtnList 	= ""

	strDesc 	=  Lang.ScriptTips.SceneBossNPC002
	okBtn 		= "{btn;0;"..Lang.ScriptTips.ButtonEnter..";%s;}"			--{按钮;样式;按钮名;函数名;描述}
	strBtnList 	= string.format(okBtn, "EnterBossSceneFromNpc")

	local pack = DataPack.allocPacket(sysarg, LogicCmd.npcDialogSys.sysID, LogicCmd.npcDialogSys.sub.sNpcDlgData)
	DataPack.writeUint64(pack, Actor.getNpc(sysarg))
	DataPack.writeByte(pack, NpcDialogType.FYSDNpcDlg)
	DataPack.writeString(pack, strCond)
	DataPack.writeString(pack, strDesc)
	DataPack.writeString(pack, strBtnList)
	DataPack.writeChar(pack, -1)
	DataPack.writeByte(pack, 0);
	DataPack.flush(pack)

	return ""
end

--进入打BOSS的场景(如其他类似功能，直接拷贝粘贴代码即可)
t.EnterBossSceneFromNpc = function ( sysarg )
	--print("EnterBossSceneFromNpc...")
	Actor.closeNPCDialog(sysarg)
	
	local sceneCfg = SceneBossNpcConfig[1]
	if not sceneCfg then
		return
	end

	CommonEnterScence( sysarg, sceneCfg, sceneCfg.enterLogId or 0, sceneCfg.enterLogDesc or "" )
end
